import request from '@/utils/request'

// 获取档案树
export function getTreesList(menuId) {
  return request({
    url: '/archive/trees/gettrees/'+menuId,
    method: 'get'
  })
}
//点击树节点获取查询框
export function getqueryfieldList(data) {
  return request({
    url: '/archive/wjzl/getqueryfieldbytreenode',
    method: 'POST',
    data: data
  })
}
//点击树节点,获取table数据
export function getlistbytreenodeList(data) {
  var d = {
    categoryId: data.categoryId,
    fields: data.fields,
    menuId: data.menuId,
    propertyName: data.propertyName,
    propertyValue: data.propertyValue,
    state: data.state,
    jsType:data.jsType,
    order: data.order,
    searchcolumn:data.searchcolumn,
    subTableName:data.sub_table_name,
    tenantCode:data.tenantCode,
  }
  return request({
    url: '/archive/wjzl/getlistbytreenode?pageNum=' + data.pageNum + '&pageSize=' + data.pageSize,
    method: 'POST',
    data: d
  })
}

//获取表头
export function getthbytreenodeHeaderList(data) {
  return request({
    url: '/archive/wjzl/getthbytreenode',
    method: 'POST',
    data: data
  })
}

//获取著录字段
export function getaddfield(data) {
  return request({
    url: '/archive/cateMdataList/getaddfield',
    method: 'POST',
    data: data
  })
}

//获修改著录字段
export function getupdatefield(data) {
  return request({
    url: '/archive/cateMdataList/getupdatefield',
    method: 'POST',
    data: data
  })
}
//获取组件详情
export function getYqdaById(data) {
  return request({
    url: '/archive/lxjs/getYqdaById',
    method: 'POST',
    data: data
  })
}

//获取组卷详情
export function getFolderById(data) {
  return request({
    url: '/archive/lxjs/getFolderById',
    method: 'POST',
    data: data
  })
}

//获取项目详情
export function getItemById(data) {
  return request({
    url: '/archive/lxjs/getItemById',
    method: 'POST',
    data: data
  })
}

//获取组件id
export function getYqdaId(query) {
  return request({
    url: '/archive/lxjs/getYqdaId',
    method: 'GET',
    params: query
  })
}
//获取过程数据
export function getBusinessInfo(daid) {
  return request({
    url: '/system/operlog/listBusinessActivity/'+daid,
    method: 'get'
  })
}

//文件上传
export function upload(data) {
  return request({
    url: '/archive/lxjs/upload',
    method: 'post',
    data: data
  })
}
//获取文件流
export function fileLiu(query) {
  return request({
    url: '/archive/detail/view',
    method: 'post',
    params: query
  })
}

//著录组件
export function addYqda(data) {
  return request({
    url: '/archive/lxjs/addYqda',
    method: 'post',
    data: data
  })
}

// 卷内件著录
export function addYqda1(data) {
  return request({
    url: '/archive/lxjs/addYqda1',
    method: 'post',
    data: data
  })
}

// 待归档--卷内件著录
export function addYqdaDgd(data) {
  return request({
    url: '/archive/lxjs/addYqdaDgd',
    method: 'post',
    data: data
  })
}


//著录组卷
export function addFolder(data) {
  return request({
    url: '/archive/lxjs/addFolder',
    method: 'post',
    data: data
  })
}

//项目层著录组卷
export function addFolder1(data) {
  return request({
    url: '/archive/lxjs/addFolder1',
    method: 'post',
    data: data
  })
}

//待归档---项目层著录组卷
export function addFolderDgd(data) {
  return request({
    url: '/archive/lxjs/addFolderDgd',
    method: 'post',
    data: data
  })
}

//著录项目
export function addProject(data) {
  return request({
    url: '/archive/lxjs/addItem',
    method: 'post',
    data: data
  })
}

//修改组件
export function updateYqda(data) {
  return request({
    url: '/archive/lxjs/updateYqda',
    method: 'post',
    data: data
  })
}

//文件整理--修改组件
export function updateYqda1(data) {
  return request({
    url: '/archive/lxjs/updateYqda1',
    method: 'post',
    data: data
  })
}

// 卷内件修改
export function updateYqda2(data) {
  return request({
    url: '/archive/lxjs/updateYqda2',
    method: 'post',
    data: data
  })
}

// 待归档--卷内件修改
export function updateYqdaDgd(data) {
  return request({
    url: '/archive/lxjs/updateYqdaDgd',
    method: 'post',
    data: data
  })
}

//修改组卷
export function updateFolder(data) {
  return request({
    url: '/archive/lxjs/updateFolder',
    method: 'post',
    data: data
  })
}

// 项目层--修改组卷
export function updateFolder1(data) {
  return request({
    url: '/archive/lxjs/updateFolder1',
    method: 'post',
    data: data
  })
}

// 待归档--项目层案卷修改
export function updateFolderDgd(data) {
  return request({
    url: '/archive/lxjs/updateFolderDgd',
    method: 'post',
    data: data
  })
}

// 文件整理--修改组卷
export function updateFolder2(data) {
  return request({
    url: '/archive/lxjs/updateFolder2',
    method: 'post',
    data: data
  })
}


//离线接收--修改项目
export function updateItem(data) {
  return request({
    url: 'archive/lxjs/updateItem',
    method: 'post',
    data: data
  })
}

//文件整理--修改项目
export function updateItem1(data) {
  return request({
    url: 'archive/lxjs/updateItem1',
    method: 'post',
    data: data
  })
}

//删除电子文件
export function delDocument(query) {
  return request({
    url: '/archive/lxjs/delDocument',
    method: 'post',
    params: query
  })
}

//获取电子文件属性信息
export function getDocumentById(data) {
  return request({
    url: '/archive/lxjs/getDocumentById',
    method: 'POST',
    data: data
  })
}


//档案接收
export function jieshou(query) {
  return request({
    url: '/archive/lxjs/jieshou',
    method: 'POST',
    params: query
  })
}
export function jieshou2(query) {
  return request({
    url: '/archive/lxjs/jieshou2',
    method: 'POST',
    params: query
  })
}

//获取展示字段
export function getshowfield(data) {
  return request({
    url: '/archive/cateMdataList/getshowfield',
    method: 'POST',
    data: data
  })
}


//根据daId获取电子文件    上传的文件
export function getDocumentBydaId(data) {
  return request({
    url: '/archive/lxjs/getDocumentBydaId',
    method: 'POST',
    data: data
  })
}

//根据项目获取卷列表/根据卷列表获取件列表
export function getlistbyparentId(data) {
  var d = {
    categoryId: data.categoryId,
    fields: data.fields,
    menuId: data.menuId,
    parentId: data.parentId,
    level: data.level,
    order: data.order,
    searchcolumn:data.searchcolumn,
    subTableName:data.sub_table_name,
    isDel: data.isDel,
    tenantCode:data.tenantCode,
  }
  return request({
    url: '/archive/detail/getlistbyparentId?pageNum=' + data.pageNum + '&pageSize=' + data.pageSize,
    method: 'POST',
    data: d
  })
}



/*
1、项目下面的案卷著录列表
2、根据项目获取卷列表/根据卷列表获取件列表

*/
export function getjianlistbyjianids(data) {
  var d = {
    categoryId: data.categoryId,
    fields: data.fields,
    menuId: data.menuId,
    jianids:data.jianids,
    order: data.order,
  }
  return request({
    url: '/archive/detail/getjianlistbyjianids?pageNum=' + data.pageNum + '&pageSize=' + data.pageSize,
    method: 'POST',
    data: d
  })
}

//获取项目下所有件
export function getjianlistbyitemId(data) {
  var d = {
    categoryId: data.categoryId,
    fields: data.fields,
    menuId: data.menuId,

    order: data.order,
    itemId:data.itemId,
    isDel: data.isDel
  }
  return request({
    url: '/archive/detail/getjianlistbyitemId?pageNum=' + data.pageNum + '&pageSize=' + data.pageSize,
    method: 'POST',
    data: d
  })
}



//文件整理删除
export function deleteData(data) {
  return request({
    url: '/archive/wjzl/delete',
    method: 'delete',
    data: data
  })
}

// 离线收集--项目删除
export function deleteData1(data) {
  return request({
    url: '/archive/wjzl/delete1',
    method: 'delete',
    data: data
  })
}

// 离线收集--案卷删除
export function deleteData2(data) {
  return request({
    url: '/archive/wjzl/delete2',
    method: 'delete',
    data: data
  })
}

// 离线收集--件删除
export function deleteData3(data) {
  return request({
    url: '/archive/wjzl/delete3',
    method: 'delete',
    data: data
  })
}

// 文件整理--项目删除
export function deleteData4(data) {
  return request({
    url: '/archive/wjzl/delete4',
    method: 'delete',
    data: data
  })
}

// 文件整理--案卷删除
export function deleteData5(data) {
  return request({
    url: '/archive/wjzl/delete5',
    method: 'delete',
    data: data
  })
}

// 文件整理--件删除
export function deleteData6(data) {
  return request({
    url: '/archive/wjzl/delete6',
    method: 'delete',
    data: data
  })
}

// 卷内件删除
export function deleteData7(data) {
  return request({
    url: '/archive/wjzl/delete7',
    method: 'delete',
    data: data
  })
}

//获取文件/案卷/项目信息

export function getDataInfo(data) {
  return request({
    url: '/archive/detail/getdatainfo',
    method: 'POST',
    data: data
  })
}

export function getefileinfobydocid(data) {
  return request({
    url: '/archive/detail/getefileinfobydocid',
    method: 'POST',
    data: data
  })
}

// 预览 获取文件流
export function viewLiu(query) {
  return request({
    url: '/archive/detail/view',
    method: 'POST',
    params: query
  })
}

//电子文件补充属性信息
export function updateDocument(data) {
  return request({
    url: '/archive/lxjs/updateDocument',
    method: 'POST',
    data: data
  })
}

//组卷
export function mergeYqda(data) {
  return request({
    url: '/archive/lxjs/mergeYqda',
    method: 'POST',
    data: data
  })
}

//合并卷

export function assemblyFolder(data) {
  return request({
    url: '/archive/lxjs/assemblyFolder',
    method: 'POST',
    data: data
  })
}

//拆卷
export function splitFolder(data) {
  return request({
    url: '/archive/lxjs/splitFolder',
    method: 'POST',
    data: data
  })
}

//组项目
export function mergeFolder(data) {
  return request({
    url: '/archive/lxjs/mergeFolder',
    method: 'POST',
    data: data
  })
}

//获取打印地址
export function geturl(data) {
  return request({
    url: '/archive/report/geturl',
    method: 'POST',
    data: data
  })
}

//备考表     返回Data  给打印地址反data参数
export function getbkbdata(data) {
  return request({
    url: '/archive/getStaticModelData/getbkbdata',
    method: 'POST',
    data: data
  })
}
//获取打印首页
export function getreportindex() {
  return request({
    url: '/archive/report/getreportindex',
    method: 'GET',

  })
}
//ofd转换
export function docToOfd(query) {
  return request({
    url: '/archive/lxjs/docToOfd',
    method: 'POST',
    params:query
  })
}

//识别
export function identify(query) {
  return request({
    url: '/archive/lxjs/identify',
    method: 'POST',
    params:query
  })
}
// 添加到归档单
export function supervisionDa(data) {
  return request({
    url: '/archive/supervisionDa',
    method: 'post',
    data: data
  })
}

// 档案管理--添加到归档单
export function supervisionDa1(data) {
  return request({
    url: '/archive/supervisionDa/add',
    method: 'post',
    data: data
  })
}

// 导入---上传
export function getTitle(data) {
  return request({
    url: 'archive/daImport/getTitle',
    method: 'post',
    data: data
  })
}
// 导入
export function uploadList(data) {
  return request({
    url: 'archive/daImport/upload',
    method: 'post',
    data: data,
    timeout:3600000
  })
}

// 导入xml
export function uploadXml(data,categoryId,categoryType) {
  return request({
    url: 'archive/daImport/uploadXml/'+categoryId+'/'+categoryType,
    method: 'post',
    data: data,
    timeout:3600000
  })
}

// 导入txt
export function uploadTxt(data,categoryId,categoryType) {
  return request({
    url: 'archive/daImport/uploadTxt/'+categoryId+'/'+categoryType,
    method: 'post',
    data: data,
    timeout:3600000
  })
}


//合并卷前验证
export function assemblyFolderVerify(data) {
  return request({
    url: '/archive/lxjs/assemblyFolderVerify',
    method: 'post',
    data: data
  })
}

//移除卷和项目关系
export function delItemFolderByFolderId(data) {
  return request({
    url: '/archive/lxjs/delItemFolderByFolderId',
    method: 'POST',
    data: data
  })
}

//拆项目
export function splitItem(data) {
  return request({
    url: '/archive/lxjs/splitItem',
    method: 'POST',
    data: data
  })
}

//绑定卷和件的关系
export function bindFolderIdDaId(data) {
  return request({
    url: '/archive/lxjs/bindFolderIdDaId',
    method: 'POST',
    data:data
  })
}

// 提交
export function submitButton(query) {
  return request({
    url: '/archive/lxjs/submit/button',
    method: 'get',
    params: query
  })
}

//著录修改时获取关联
export function getrelevanceforadd(data) {
  return request({
    url: '/archive/cateMdataList/getrelevanceforadd',
    method: 'POST',
    data: data
  })
}

//获取拆分后的图片列表
export function cutBigPdf(query) {
  return request({
    url: 'archive/detail/cutBigPdf',
    method: 'POST',
    params: query
  })
}


//获取水印
export function sydm(query) {
  return request({
    url: '/archive/yqSy/sydm',
    method: 'GET',
    params: query
  })
}
//ofd文件遮盖
export function getKeyWord(query) {
  return request({
    url: '/archive/archiveBorrow/getKeyWord',
    method: 'POST',
    params: query
  })
}

//修改保管期限

export function updateBgqx(data) {
  return request({
    url: '/archive/lxjs/updateBgqx',
    method: 'POST',
    data: data
  })
}


///detail/getOfdFile这个接口参数和/detail/view参数一致

export function getOfdFile(data) {
  return request({
    url: '/archive/detail/getOfdFile',
    method: 'POST',
    data: data
  })
}

export function ofdReadName(query) {
  return request({
    url: 'archive/syConfig/ofdReadName',
    method: 'GET',
    params: query
  })
}

//判断pdf文件是否加密
export function pdfIsEncryption(data) {
  return request({
    url: '/archive/detail/pdfIsEncryption',
    method: 'post',
    data: data
  })
}

// 下载移交清单
export function downloadDocx(query) {
  return request({
    url: '/archive/archiveFormSave/downloadArchiveTableNew',
    method: 'POST',
    data: query
  })
}

// 著录获取归档范围字段
export function getfieldbycategoryid(query) {
  return request({
    url: '/archive/gdfwandbgqx/getfieldbycategoryid?categoryId='+query.categoryId+"&type="+query.type,
    method: 'GET',

  })
}

// 字段值改变时获取保管期限
export function getbgqxbyfile(query) {
  return request({
    url: '/archive/gdfwandbgqx/getbgqxbyfile',
    method: 'POST',
    data: query
  })
}
//修改文件密级
export function changeFileMj(data) {
  return request({
    url: '/archive/lxjs/changeFileMj',
    method: 'POST',
    data: data
  })
}

//根据档案密级和文件密级进行判断
export function determine(data) {
  return request({
    url: 'archive/mjdzb/determine',
    method: 'POST',
    data: data
  })
}


//查询fb状态  是否分保状态
export function fbstat() {
  return request({
    url: 'archive/dazl/fb/stat',
    method: 'POST',
  })
}

//根据人员密级获取能查看的档案密级
export function getdamjbyrymj() {
  return request({
    url: '/archive/mjdzb/getdamjbyrymj',
    method: 'POST',
  })
}